using System;
using System.Text.RegularExpressions;
using JinianNet.JNTemplate;
using Xunit;
using YTS.Tools;

namespace LanguageLearnTestCase.String
{
    public class TestGenJNTemplateHTML
    {
        // [Fact]
        public void OverrideSet()
        {
            ITemplate template = Engine.LoadTemplate(@"E:\Document\test_gen_index.html");
            ITemplate template2 = Engine.CreateTemplate(@"E:\Document\test_gen_index.html");

            template.Set("name", "jntemplate");
            template.Set("list", new object[] {
                new {
                    Id=1
                },
                new {
                    Id=2
                },
                new {
                    Id=3
                }
            });

            template.Set<Func<int, string[]>>("getList", (id) =>
            {
                return new string[] { $"a{id}", $"b{id}", $"c{id}" };
            });

            string result = template.Render();
            Assert.True(result != null);
        }
    }
}
